/**
 *
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 *
 */
package org.baatar.remoting.test.impl.client;

import org.baatar.net.client.TCPClient;
import org.baatar.remoting.message.RemoteRequest;
import org.baatar.remoting.test.intf.IMathService;

/**
 * Client implementor of the remote math service.
 * Instances of this class are send math requests to the math remote service.
 * 
 * @author B_ZEREN
 */
public class MathServiceClient extends TCPClient implements IMathService {

    public Double add(Double a, Double b) throws Exception {
        return sendMessage(new RemoteRequest(callerInfo, "add", a, b), Double.class).getResult();
    }

    public Double substract(Double a, Double b) throws Exception {
        return sendMessage(new RemoteRequest(callerInfo, "substract", a, b), Double.class).getResult();
    }

    public Double multiply(Double a, Double b) throws Exception {
        return sendMessage(new RemoteRequest(callerInfo, "multiply", a, b), Double.class).getResult();
    }

    public Double divide(Double a, Double b) throws Exception {
        return sendMessage(new RemoteRequest(callerInfo, "divide", a, b), Double.class).getResult();
    }
    
}
